<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    
</head>
<body>
    <div id="app-one">
        <h1>{{ title }}</h1>
        <p>
            {{ greet }}
        </p>
    </div>
    <div id="app-two">
        <h1>{{ title }}</h1>
        <p>{{ greet }}</p>

        <button v-on:click="change">修改app one的数据</button>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <script>
        var one = new Vue({
            el:"#app-one",
            data:{
               title:"App One Title"
            },
            methods:{
               
            },
            computed:{
                greet:function(){
                    return "hello app one";
                }
            }
            
        });
        var two = new Vue({
            el:"#app-two",
            data:{
                title:"App Two Title"
            },
            methods:{
                // 修改one的数据需要在这里调用one.title
                change:function(){
                    one.title = "修改过的title";
                }
            },
            computed:{
                greet:function(){
                    return "hello app two";
                }
            }
        });
        // 修改two 的数据
        two.title = "已经修改了two的数据了";
    </script>
</body>
</html>